<template>
    <div class="person">
        <h2>当前求和为{{ sum }}</h2>
        <button @click="add()">点我sum+1</button>
        <hr>
        <img  v-for="(dog,index) in dogList" :src="dog" :key="index" alt="">
        <br>
        <button @click="getDog()">再来一只小狗</button>
    </div>
</template>

<script setup lang="ts">
import useSum from '@/hooks/useSum';
import useDog from '@/hooks/useDog';

// 接口地址：https://dog.ceo/api/breed/pembroke/images/random
const {sum,add}=useSum()
const {dogList,getDog}=useDog()


</script>

<style>
img{
    height: 100px;
    margin-right: 10px;
}
</style>